function f_create_test_env()
{   #给相应的表, 搭建测试环境
    declare _table_name is_has_table_sql get_create_table_sql _tmp_table_list fun_name
    fun_name="f_create_test_env"
    _table_name="$(sed 's/`//g' <<< "${1}")"
    _tmp_table_list="${2}"
    is_has_table_sql="$(f_exe_sql_in_mysql "show tables from ${_mysql_db_} like '${_table_name}'"|grep -c "^${_table_name}$")" || true
    if [ "${is_has_table_sql}x" != "1x" ]
    then
        f_logging "ERROR:${fun_name}" "'${mysql_host}:${mysql_port}' 没有表 '${mysql_db}.${_table_name}'" "2" >&2
        return 1
    fi
    f_check_foreign_key "${_table_name}" "父表" "father" || return 1 #检查是否有父表
    get_create_table_sql="$(f_exe_sql_in_mysql "show create table ${_mysql_db_}.\`${_table_name}\`\G"|awk '{if (NR>2) print $0}')"
    if [ -n "${get_create_table_sql}" ] && [ "$(grep -cw "${_table_name}" <<< "${_tmp_table_list}")x" == "0x" ] #本次没有检查到的表就创建
    then
        is_has_table_sql="$(f_exe_sql_in_test_mysql "show tables"|grep -cw "${_table_name}")" || true
        if [ "${is_has_table_sql}x" == "0x" ]
        then
            f_exe_sql_in_test_mysql "${get_create_table_sql}" && exe_state="${?}" || exe_state="${?}"
            if [ "${mode_opt}x" == "alter_tablex" ] || [ "${mode_opt}x" == "create_tablex" ]
            then
                f_exe_sql_in_test_mysql "${get_create_table_sql}" "${test_db_exe}" && exe_state="${?}" || exe_state="${?}"
            fi
        fi
        
        exe_state="$(f_exe_sql_in_test_mysql "show tables"|grep -cw "${_table_name}")" || true
        if [ ${exe_state} -eq 0 ]
        then
            f_logging "ERROR:${fun_name}" "'${test_host}:${test_port}' 创建 '${_table_name}' 失败" "2" >&2
            return 1
        else
            f_logging "INFO:${fun_name}" "'${test_host}:${test_port}' 创建 '${_table_name}' 成功" "execute:${execute}" >&2
            f_check_foreign_key "${_table_name}" "子表" "son" || return 1 #检查是否有子表
        fi
    else 
        f_logging "WARN:${fun_name}" "'${test_host}:${test_port}' '${_table_name}' 已经存在" >&2
    fi
    return 0
}

